home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 276_01 / a684.doc < prev    next >
Text File  |  1989-10-01  |  47KB  |  1,236 lines

  1. /*
  2.     HEADER:        CUG276;
  3.     TITLE:        6804 Cross-Assembler (Portable);
  4.     FILENAME:    A684.DOC;
  5.     VERSION:    0.1;
  6.     DATE:        08/27/1988;
  7.  
  8.     DESCRIPTION:    "This program lets you use your computer to assemble
  9.             code for the Motorola 6804 family microprocessors.
  10.             The program is written in portable C rather than BDS
  11.             C.  All    assembler features are supported except
  12.             relocation linkage, and macros.";
  13.  
  14.     KEYWORDS:    Software Development, Assemblers, Cross-Assemblers,
  15.             Motorola, MC6804;
  16.  
  17.     SYSTEM:        CP/M-80, CP/M-86, HP-UX, MSDOS, PCDOS, QNIX;
  18.     COMPILERS:    Aztec C86, Aztec CII, CI-C86, Eco-C, Eco-C88, HP-UX,
  19.             Lattice C, Microsoft C,    QNIX C;
  20.  
  21.     WARNINGS:    "This program should compile under any full-featured
  22.             C compiler.  Subset compilers such as Toolworks C and
  23.             BDS C pose a problem."
  24.  
  25.     AUTHORS:    William C. Colley III;
  26. */
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.                            6804 Cross-Assembler (Portable)
  42.  
  43.  
  44.                                      Version 0.1
  45.  
  46.  
  47.                    Copyright (c) 1985, 1988 William C. Colley, III
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.                               The manual such as it is.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.           Legal Note:    This package may be used for any commercial or
  67.                          non-commercial purpose.  It may be copied and
  68.                          distributed freely provided that any fee charged
  69.                          by the distributor of the copy does not exceed the
  70.                          sum of:  1) the cost of the media the copy is
  71.                          written on,  2) any required costs of shipping the
  72.                          copy, and  3) a nominal handling fee.  Any other
  73.                          distribution requires the written permission of
  74.                          the author.  Also, the author's copyright notices
  75.                          shall not be removed from the program source, the
  76.                          program object, or the program documentation.
  77.  
  78.  
  79.  
  80.                                   Table of Contents
  81.  
  82.           1.0  How to Use the Cross-Assembler Package ..................  3
  83.           2.0  Format of Cross-Assembler Source Lines ..................  4
  84.                2.1  Labels .............................................  5
  85.                2.2  Numeric Constants ..................................  5
  86.                2.3  String Constants ...................................  6
  87.                2.4  Expressions ........................................  6
  88.           3.0  Machine Opcodes .........................................  7
  89.                3.1  Opcodes -- No Arguments ............................  7
  90.                3.2  Opcodes -- Relative Branch Instructions ............  8
  91.                3.3  Opcodes -- Long Branch Instructions ................  8
  92.                3.4  Opcodes -- Bit Manipulation Instructions ...........  8
  93.                3.5  Opcodes -- Arithmetic and Logical Instructions .....  8
  94.                3.6  Opcodes -- MVI .....................................  9
  95.                3.7  Opcodes -- Short Direct Addressing .................  9
  96.           4.0  Pseudo Opcodes .......................................... 10
  97.                4.1  Pseudo-ops -- END .................................. 10
  98.                4.2  Pseudo-ops -- EQU .................................. 10
  99.                4.3  Pseudo-ops -- FCB .................................. 10
  100.                4.4  Pseudo-ops -- FCC .................................. 11
  101.                4.5  Pseudo-ops -- FDB .................................. 11
  102.                4.6  Pseudo-ops -- IF, ELSE, ENDIF ...................... 11
  103.                4.7  Pseudo-ops -- INCL ................................. 12
  104.                4.8  Pseudo-ops -- ORG .................................. 12
  105.                4.9  Pseudo-ops -- PAGE ................................. 13
  106.                4.10 Pseudo-ops -- RMB .................................. 13
  107.                4.11 Pseudo-ops -- SET .................................. 13
  108.                4.12 Pseudo-ops -- TITLE ................................ 13
  109.           5.0  Assembly Errors ......................................... 14
  110.                5.1  Error * -- Illegal or Missing Statement ............ 14
  111.                5.2  Error ( -- Parenthesis Imbalance ................... 14
  112.                5.3  Error " -- Missing Quotation Mark .................. 14
  113.                5.4  Error A -- Illegal Addressing Mode ................. 14
  114.                5.5  Error B -- Branch Target Too Distant ............... 15
  115.                5.6  Error D -- Illegal Digit ........................... 15
  116.                5.7  Error E -- Illegal Expression ...................... 15
  117.                5.8  Error I -- IF-ENDIF Imbalance ...................... 15
  118.                5.9  Error L -- Illegal Label ........................... 15
  119.                5.10 Error M -- Multiply Defined Label .................. 16
  120.                5.11 Error O -- Illegal Opcode .......................... 16
  121.                5.12 Error P -- Phasing Error ........................... 16
  122.                5.13 Error S -- Illegal Syntax .......................... 16
  123.                5.14 Error T -- Too Many Arguments ...................... 16
  124.                5.15 Error U -- Undefined Label ......................... 16
  125.                5.16 Error V -- Illegal Value ........................... 17
  126.           6.0  Warning Messages ........................................ 17
  127.                6.1  Warning -- Illegal Option Ignored .................. 17
  128.                6.2  Warning -- -l Option Ignored -- No File Name ....... 17
  129.                6.3  Warning -- -o Option Ignored -- No File Name ....... 17
  130.                6.4  Warning -- Extra Source File Ignored ............... 17
  131.                6.5  Warning -- Extra Listing File Ignored .............. 18
  132.                6.6  Warning -- Extra Object File Ignored ............... 18
  133.  
  134.  
  135.  
  136.  
  137.                                      1
  138.  
  139.  
  140.  
  141.           7.0  Fatal Error Messages .................................... 18
  142.                7.1  Fatal Error -- No Source File Specified ............ 18
  143.                7.2  Fatal Error -- Source File Did Not Open ............ 18
  144.                7.3  Fatal Error -- Listing File Did Not Open ........... 18
  145.                7.4  Fatal Error -- Object File Did Not Open ............ 18
  146.                7.5  Fatal Error -- Error Reading Source File ........... 18
  147.                7.6  Fatal Error -- Disk or Directory Full .............. 18
  148.                7.7  Fatal Error -- File Stack Overflow ................. 19
  149.                7.8  Fatal Error -- If Stack Overflow ................... 19
  150.                7.9  Fatal Error -- Too Many Symbols .................... 19
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.                                      2
  199.  
  200.  
  201.  
  202.           1.0  How to Use the Cross-Assembler Package
  203.  
  204.                First, the question, "What does a cross-assembler do?" needs
  205.           to be addressed as there is considerable confusion on this point.
  206.           A cross-assembler is just like any other assembler except that it
  207.           runs on some CPU other than the one for which it assembles code.
  208.           For example, this package assembles 6804 source code into 6804
  209.           object code, but it runs on an 8080, a Z-80, an 8088, or whatever
  210.           other CPU you happen to have a C compiler for.  The reason that
  211.           cross-assemblers are useful is that you probably already have a
  212.           CPU with memory, disk drives, a text editor, an operating system,
  213.           and all sorts of hard-to-build or expensive facilities on hand.
  214.           A cross-assembler allows you to use these facilites to develop
  215.           code for a 6804.
  216.  
  217.           This program requires one input file (your 6804 source code) and
  218.           zero to two output files (the listing and the object).  The input
  219.           file MUST be specified, or the assembler will bomb on a fatal
  220.           error.  The listing and object files are optional.  If no listing
  221.           file is specified, no listing is generat